package cn.ztr.ymcc.feign;

import cn.ztr.ymcc.CourseDOC;
import cn.ztr.ymcc.feign.impl.SearchFeignImpl;
import cn.ztr.ymcc.result.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "service-search",fallbackFactory = SearchFeignImpl.class)
public interface SearchFeign {

    /**
     * 批量添加课程信息到es
     * @param courseDOCList
     * @return
     */
    @PostMapping("/search/saveBatch")
    public JsonResult saveBatch(@RequestBody List<CourseDOC> courseDOCList);

    /**
     * 批量删除课程信息从es
     * @param courseDOCList
     * @return
     */
    @PostMapping("/deleteBatch")
    public JsonResult deleteBatch(@RequestBody List<CourseDOC> courseDOCList);
}
